package com.yuyou.activity.comm.service.service.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuyou.activity.comm.service.entity.PayApplyNoticeTrade;
import com.yuyou.activity.comm.service.mapper.PayApplyNoticeTradeMapper;
import com.yuyou.activity.comm.service.service.IPayApplyNoticeTradeService;
import com.yuyou.activity.util.bean.ResBoolSimpleInfo;
import com.yuyou.activity.util.util.Sequence;

@Service
public class PayApplyNoticeTradeServiceImpl implements IPayApplyNoticeTradeService{

	@Autowired
	private PayApplyNoticeTradeMapper payApplyNoticeTradeMapper;
	
	@Override
	public int deleteByPrimaryKey(Long payApplyNoticeTradeId) {
		return payApplyNoticeTradeMapper.deleteByPrimaryKey(payApplyNoticeTradeId);
	}

	@Override
	public int insert(PayApplyNoticeTrade record) {
		record.setPayApplyNoticeTradeId(Sequence.getSequence().nextId());
		record.setCreateTime(new Date());
		return payApplyNoticeTradeMapper.insert(record);
	}

	@Override
	public PayApplyNoticeTrade selectByPrimaryKey(Long payApplyNoticeTradeId) {
		return payApplyNoticeTradeMapper.selectByPrimaryKey(payApplyNoticeTradeId);
	}

	@Override
	public int updateByPrimaryKeySelective(PayApplyNoticeTrade record) {
		return payApplyNoticeTradeMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public ResBoolSimpleInfo<String> add(PayApplyNoticeTrade record) {
		this.insert(record);
		return ResBoolSimpleInfo.getSuccessInfo();
	}
	
}